/*
 * @Author: yyf
 * @Date: 2018-05-10
 * @description: 事件--评估公司
*/

import { apiHttp } from '../../apiHttp';
import Api from '../../../api/event/eventAppraiseController.api';
import { JsonResult, EventAppraiseDto, EventAppraiseReportDto } from '../../../api/Interface';
import { EventPublicSearchDto } from '../Interface';

export default {
    // 删除评估公司
    deleteEventAppraise: async (id: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.deleteEventAppraise, {id});
        return res;
    },
    // 获取评估公司列表
    getEventAppraisePage: async (eventPublicSearchDto: EventPublicSearchDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.EventAppraisePage, eventPublicSearchDto);
        return res;
    },
    // 添加评估公司
    saveEventAppraise: async (eventAppraiseDto: EventAppraiseDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.saveEventAppraise, eventAppraiseDto);
        return res;
    },
    // 编辑评估公司
    updateEventAppraise: async (eventAppraiseDto: EventAppraiseDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.updateEventAppraise, eventAppraiseDto);
        return res;
    },
    // 添加/更新 评估公司-报告
    saveOrUpdateEventAppraiseReport: async (eventAppraiseReportDto: EventAppraiseReportDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.saveOrUpdateEventAppraiseReport, eventAppraiseReportDto);
        return res;
    },
    // 根据评估公司-主id 查询关联报告信息
    getEventAppraiseReport: async (businessId: string): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getEventAppraiseReport, {businessId});
        return res;
    },
    
};